package com.yfl.tingyu.mapper;

import com.yfl.tingyu.pojo.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2020-05-26
 */
public interface MenuMapper extends BaseMapper<Menu> {

    @Select("SELECT * from t_menu where mid in (SELECT mid from t_role_menu where rid=(SELECT rid from t_admin_role WHERE aid=#{aid}))")
    List<Menu> selectAdminMenu(Integer aid);

    @Select("select * from t_menu")
    List<Menu> allList();
}
